home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2109 < prev    next >
Encoding:
Text File  |  1996-08-06  |  995 b   |  39 lines

  1. Path: venere.inet.it!usenet
  2. From: gbrunori@sb1.shiny.it (Gabriele Brunori)
  3. Newsgroups: comp.lang.c++
  4. Subject: How can I use ODBC.DLL ?
  5. Date: Sat, 13 Jan 1996 21:42:10 GMT
  6. Organization: I.Net S.p.A.
  7. Message-ID: <4d9952$32ic@venere.inet.it>
  8. Reply-To: gbrunori@sb1.shiny.it
  9. NNTP-Posting-Host: 194.20.237.138
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. I have tried to create a new database using ODBC driver with my C application, but
  13. the linker return to me this errors:
  14.  
  15. Linker error: Undefined symbol _SQLAllocEnv in module ...
  16. Linker error: Undefined symbol _SQLExecDirect in module ...
  17.    ...
  18.  
  19. I have loaded the ODBC exported functions in this way:
  20.  
  21. extern SQLAllocEnv(LONG hEnv);
  22. extern SQLAllocStmt(LONG hEnv, LONG hStmt);
  23. ....
  24. {
  25. LONG hEnv,hStmt;
  26. int LSqlStmt;
  27. HINSTANCE hODBC = LoadLibrary("C:\WINDOWS\SYSTEM\ODBC.DLL");  // I have BC 3.1 
  28. if ( SQLAllocEnv(hEnv) == 0 )
  29.     {
  30.     SQLAllocStmt(hEnv, hStmt);
  31.          ....
  32. }
  33.  
  34. Is There anybody that can correct my source ?
  35. Thanks in advance.
  36. Gabriele.
  37.  
  38.  
  39.